fix: chronicle start runs Nitro production server#76
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…view Replace Vite preview() with spawning node .output/server/index.mjs for proper SSR, API routes, and search in production. Checks build exists, forwards signals to child process. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Issues
-
servecommand is now inconsistent —serve.tsstill uses Vitepreview()(build + preview). After this PR,serve(build+start) andbuild && startwill behave differently:servewon't have SSR/API routes, butstartwill.serveshould be updated to call the same Nitro spawn logic, or be deprecated. -
Vercel preset path assumption —
resolveServerEntryhardcodes.vercel/output/server/index.mjs. Vercel's serverless output doesn't produce a standaloneindex.mjsyou cannode-run directly — its output is designed for Vercel's runtime. Runningchronicle start --preset vercelwould likely fail silently or with a confusing error. Consider either validating the preset isn't a serverless target, or dropping Vercel fromstartand only supporting it inbuild.
Minor
configPathandlinkContentare now unused —loadCLIConfigstill returnsconfigPathandconfig, but the new code doesn't calllinkContent. This is fine forstart(content was linked at build time), but worth a comment or removing the unused destructured variable.
Summary
chronicle startwas using Vitepreview()— a static file server that doesn't run Nitro SSR, API routes, or search. Now it spawnsnode .output/server/index.mjs(the actual Nitro production server).Before
allowedHostserrors in DockerAfter
Test plan
chronicle build && chronicle start— full SSR works/api/search,/api/health) respond🤖 Generated with Claude Code